import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import Login from '../components/Login.vue'
import Register from '../components/Register.vue'
import Home from '../components/Home.vue'
import Contact from '../components/homeContainer/contact.vue'
import Contact1 from '../components/homeContainer/contact1.vue'
import Contact2 from '../components/homeContainer/contact2.vue'
import Menu from '../components/Menu.vue'
import About from '../components/About.vue'
import Admin from '../components/Admin.vue'
import GuanLi from '../components/guanLi.vue'
import zhenMenu from '../components/zhenMenu.vue'
Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'registerLink',
        component: Register
    },
    {
        path: '/guanLi',
        name: 'guanLiLink',
        component: GuanLi
    },
    {
        path: '/zhenMenu',
        name: 'zhenMenuLink',
        component: zhenMenu
    },
    {
        path: '/about',
        name: 'aboutLink',
        component: About
    },
    {
        path: '/admin',
        name: 'adminLink',
        component: Admin
    },
    {
        path: '/login',
        name: 'loginLink',
        component: Login
    }, {
        path: '/home',
        name: 'homeLink',
        components: {
            default: Home,
            'contact': Contact,
            'contact1': Contact1,
            'contact2': Contact2
        },
        children: [{
            path: '/menu',
            name: 'menuLink',
            component: Menu

        }]
    }

    // {
    //   path: '/',
    //   name: 'Home',
    //   component: Home
    // },
    // {
    //   path: '/about',
    //   name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    // }
]

const router = new VueRouter({
    routes
})

export default router